<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>Display credit limit ranges in the table of contents</title>
    <link rel="StyleSheet" href="css/grouping.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="sg-PreviewTheReportInTheBIRTReportViewer.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="ag-AggregatingData.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h3 class="N_TutorialTask">Task 10:&nbsp;&nbsp;<a name="236380">Display credit limit ranges in the table of contents</a></h3>
      <p class="b_Body"><a name="192575">Rather than display the first value of each credit limit group, the table of contents makes more sense if it displays the same credit limit range values as the report. You accomplish this task by using the same JavaScript expression that you used previously to display credit limit ranges (0&nbsp;-&nbsp;49999, 50000&nbsp;-&nbsp;99999, and so on) in the group header.</a></p>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">1&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="192576">Return to BIRT Report Designer.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">2&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="192577">In the layout editor, select the table, then choose the Groups tab in Property Editor.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">3&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="192578">Double-click credit_group in the list of groups. </a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_i_Indent1"><a name="313029">Edit Group, shown in </a><a href="#507252" title="Display credit limit ranges in the table of contents">Figure&nbsp;7-30</a>, displays the properties of the group. Under Table of Contents, Item Expression is set, by default, to the grouping field, row["CREDITLIMIT"].</div>
      <p class="i2_Image2"><a name="507250"><img class="Default" src="images/grouping.07.12.1.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 7-30 Edit Group displaying the properties of credit_group" /></a></p>
      <div class="fc2_FigCall2Title">
        <b class="Bold">Figure&nbsp;7-30&nbsp;&nbsp;</b><a name="507252">Edit Group displaying the properties of credit_group</a></div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">4&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="456403">Choose the expression builder button, and, in the expression builder, replace the row["CREDITLIMIT"] expression with the following expression. This expression is the same column-binding expression that is used by the data element, [CREDIT_GRP_HEADER], in the group header. Rather than typing the expression again, you can copy it from the data element and paste it here.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="cfi_CodeFirstIndent"><a name="209589">for(i=50000; i&lt;300000; i+=50000){</a></div>
      <div class="coi2_CodeIndent2"><a name="192584">if( row["CREDITLIMIT"] &lt; i ){</a></div>
      <div class="coi2_CodeIndent2"><a name="192585">&nbsp;&nbsp;rangeStart = i-50000;</a></div>
      <div class="coi2_CodeIndent2"><a name="192586">&nbsp;&nbsp;rangeEnd = i-1;</a></div>
      <div class="coi2_CodeIndent2"><a name="192587">&nbsp;&nbsp;break;</a></div>
      <div class="coi2_CodeIndent2"><a name="192588">}</a></div>
      <div class="coi_CodeIndent"><a name="192589">}</a></div>
      <div class="coi_CodeIndent"><a name="192590">displayString = rangeStart + " - " + rangeEnd;</a></div>
      <div class="N_i_Indent1"><a name="192592">Choose OK to save the expression.</a></div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">5&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="394421">Choose OK to save the edits to the group.</a></div>
            </td>
          </tr>
        </table>
      </div>
      <div class="N_n1_NumList1_outer" style="margin-left: 0pt">
        <table border="0" cellspacing="0" cellpadding="0" summary="" role="presentation">
          <tr style="vertical-align: baseline">
            <td>
              <div class="N_n1_NumList1_inner" style="width: 14.1732283464567pt; white-space: nowrap">
                <span class="zAuto_0023Format">6&nbsp;&nbsp;</span>
              </div>
            </td>
            <td width="100%">
              <div class="N_n1_NumList1_inner"><a name="192593">Preview the report in the report viewer to verify the change in the table of contents. The table of contents displays the credit limit ranges, as shown in </a><a href="#507292" title="Display credit limit ranges in the table of contents">Figure&nbsp;7-31</a>.</div>
            </td>
          </tr>
        </table>
      </div>
      <p class="i1_Image1"><a name="507290"><img class="Default" src="images/grouping.07.12.2.png" style="display: inline; float: none; left: 0.0; top: 0.0" alt="Figure 7-31 Updated table of contents" /></a></p>
      <div class="fc_FigCalloutTitle">
        <b class="Bold">Figure&nbsp;7-31&nbsp;&nbsp;</b><a name="507292">Updated table of contents</a></div>
      <p class="b_Body"><a name="192620">&nbsp;</a></p>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>